
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using ODataRegression.Framework.Core;
using ODataRegression.Framework.Core.MetaDataOM;

namespace ODataRegression.Framework.Core.Shared
{
    public enum UriResultType { Metadata, Feed, Entry, Property, PropertyValue, None };
	


    public class PayloadAnalyzer
    {
      
        /// <summary>
        /// This function examine the name of a xml element and return the type of payload.
        /// </summary>
        /// <param name="content">The Atom format payload of response</param>
        /// <returns></returns>
        public static UriResultType getResultType(XElement payload)
        {
            if (payload.Name == ODataNameSpaces.AtomNamespace + "feed")
				return UriResultType.Feed;
            else if (payload.Name == ODataNameSpaces.AtomNamespace + "entry")
				return UriResultType.Entry;
            else if (payload.Name == ODataNameSpaces.EdmxNamespace + "Edmx")
				return UriResultType.Metadata;

			return UriResultType.Property;      
        }      
    }
	
	
}